/*!
 @file MujiVideoPlayerView.h
 @framework ECCoreLibrary

 @author Created by Samuel Chow on 8/12/13.
 @copyright Copyright (c) 2013 EnglishCentral, Inc. All rights reserved.
 @internal
*/

#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>

@class AVPlayer;

@protocol MujiVideoPlayerViewDelegate;

@interface MujiVideoPlayerView : UIView

@property (nonatomic, strong) AVPlayer *player;
@property (readonly, nonatomic, weak) AVPlayerLayer *playerLayer;
@property (nonatomic, copy) NSString *videoFillMode;
@property (readonly, nonatomic, assign, getter = isReadyForVisualDisplay) BOOL readyForVisualDisplay;
@property (nonatomic, weak) id<MujiVideoPlayerViewDelegate> delegate;
@property (readonly, nonatomic, assign, getter = isPlaying) BOOL playing;

- (void)play;
- (void)pause;
- (void)seekToTime:(CMTime)time;
- (void)seekToTime:(CMTime)time completion:(void(^)(void))completion;

- (void)seekToTime:(CMTime)time toleranceBefore:(CMTime)toleranceBefore toleranceAfter:(CMTime)toleranceAfter completionHandler:(void (^)(BOOL finished))completionHandler;


@end


@protocol MujiVideoPlayerViewDelegate <NSObject>

@optional

- (void)videoPlayerView:(MujiVideoPlayerView *)videoPlayerView isReadyForVisualDisplay:(BOOL)readyForVisualDisplay;

@end

